function meta_analysis_LFMplot(proj_meta,cur_site,cell,pl_cells,fb_snip,pb_snip,fb_av,pb_av)

a(1,:)=[2649         755         409         241];
a(2,:)=[2649         393         409         241];
a(3,:)=[2649          41         409         241];
a(4,:)=[3115         756         409         241];
a(5,:)=[3115         393         409         241];
a(6,:)=[3456         755         409         241];
a(7,:)=[3456         393         409         241];

if max(pl_cells)~=cell
    pl=find(pl_cells>=cell,1,'first');
    if pl>1
        corr_cell=cell-pl_cells(pl-1);
    else
        corr_cell=cell;
    end
else
    pl=length(pl_cells);
    corr_cell=cell-pl_cells(pl-1);
end
    
for tnd=1:size(proj_meta(cur_site).rd,2)
    nbr_frames=proj_meta(cur_site).rd(1,tnd).nbr_frames;
    stim_id=proj_meta(cur_site).rd(1,tnd).ps_id;
    runP=proj_meta(cur_site).rd(1,tnd).velP_smoothed>0.01;
    runM=proj_meta(cur_site).rd(1,tnd).velM_smoothed>0.01;
    runM_raw=proj_meta(cur_site).rd(1,tnd).velM_smoothed;
    
    act=proj_meta(cur_site).rd(pl,tnd).act(corr_cell,:);
    
    [fb_snips_av,pb_snips_av,fb_snips_out,pb_snips_out]=pert_ana_meta(nbr_frames,stim_id,runM,runP,runM_raw,act);
    data_lwin=15;
    data_rwin=25;
    
    % data_lwin=20;
    % data_rwin=50;
    
    curYmax=0;
    snipy=[];
    for ynd=1:length(fb_snips_out)
        if isempty(fb_snips_out{ynd})
            snipy(ynd)=0;
        else
            snipy(ynd)=max([max(max(fb_snips_out{ynd})) max(max(pb_snips_out{ynd}))]);
        end
        
        curYmax=max([curYmax snipy]);
    end
    
    curYmax=max([curYmax 2]);
    
    sequ=[1 2 3 8 9 10 4 5 6 11 12 13 7];
    figure(2+tnd);
    clf
    set(gcf,'pos',a(tnd,:))
    for ind=1:13
        subplot(2,7,sequ(ind))
        rectangle('position',[15 0 10 4],'facecolor',[0.95 0.95 0.95],'linestyle','none')
        if ~isempty(fb_snips_av{ind})
            hold on
            plot(fb_snips_out{ind},'color',[1 0.7 0.7])
        end
        if ~isempty(pb_snips_av{ind})
            hold on
            plot(pb_snips_out{ind},'color',[0.5 0.5 0.5])
        end
        if ~isempty(fb_snips_av{ind})
            hold on
            plot(fb_snips_av{ind},'color',[1 0 0],'LineWidth',2)
        end
        if ~isempty(pb_snips_av{ind})
            hold on
            plot(pb_snips_av{ind},'color',[0 0 0],'LineWidth',2)
        end
        axis tight
        axis off
        box off
        ylim([0 curYmax])
        xlim([0 data_rwin+data_lwin+1])
        drawnow
    end
end
